package com.itheima.homework.homework04;

import java.time.Duration;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Test04 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入您入职的日期,格式为：xxxx年xx月xx日");
        String s = sc.nextLine();
        s+=" 00时00分00秒";
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH时mm分ss秒");
        LocalDateTime parse = LocalDateTime.parse(s, pattern);

        LocalDateTime localDateTime = LocalDateTime.now();
        Duration duration = Duration.between(parse, localDateTime);
        System.out.println("您已入职公司"+duration.toDays()+"天");
    }
}
